ProtocolConnection

class ProtocolConnection(frames: WebSocketFramesStream, eventMapper: EventMapper, sessionId: SessionID?) : Closeable, AutoCloseable

ProtocolConnection represents connection to chrome's debugger via DevTools Protocol.

It depends on WebSocketFramesStream which is responsible for providing stream of WebSocket frames (both events and responses) and allows for sending request frames.

EventMapper is responsible for mapping pl.wendigo.chrome.protocol.websocket.EventResponseFrames to concrete Event representations.

See also

Constructors

ProtocolConnection
Link copied to clipboard
fun ProtocolConnection(frames: WebSocketFramesStream, eventMapper: EventMapper = ProtocolConnection.eventMapper, sessionId: SessionID? = null)

Types

Factory
Link copied to clipboard
object Factory
Factory is responsible for opening debugger WebSocket connections to a given debugger uri.

Functions

close
Link copied to clipboard
open override fun close()
Closes connection to remote debugger.
events
Link copied to clipboard
fun events(): Flowable<Event>
Captures all events as generated by remote debugger
fun <T : Event> events(eventName: String, serializer: KSerializer<T>): Flowable<T>
Captures events by given name and casts received messages to specified class.
request
Link copied to clipboard
fun <T> request(methodName: String, request: JsonElement?, responseSerializer: KSerializer<T>): Single<T>
Sends request and captures response from the stream.

Sources

jvm source
Link copied to clipboard